package top.retain;

/**
 * @author ivorfan
 * @date 2021/8/31 23:08
 */
public class Flight {

    public static void main(String[] args) {

//        int[][] ints = {{1, 2, 10}, {2, 3, 20}, {2, 5, 25}};
//        corpFlightBookings(ints,5);
    }
    public static int m() {
        int a = 1;
        try {
            return a;
        }finally {
          a++;
        }
    }

    public static int[] corpFlightBookings(int[][] bookings, int n) {
        int[] nums = new int[n];
        for (int[] booking : bookings) {
            nums[booking[0] - 1] += booking[2];
            if (booking[1] < n) {
                nums[booking[1]] -= booking[2];
            }
        }
        for (int i = 1; i < n; i++) {
            nums[i] += nums[i - 1];
        }
        return nums;
    }
}
